Skip to content

Flake devShell #1549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 29, 2025
Merged

Flake devShell #1549

merged 3 commits into from
Mar 29, 2025

Conversation

Sk7Str1p3
Copy link
Contributor

little flake for development shell with nix

Copy link
Collaborator

@spenserblack spenserblack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I'll read up on flake dev shells before merging.

I think you need to add .direnv to the .gitignore, don't you?

@spenserblack
Copy link
Collaborator

Oh, maybe add a .nix entry to .editorconfig so our editors follow the appropriate standard if we ever update flake.nix.

@Sk7Str1p3
Copy link
Contributor Author

Ready to merge

Copy link
Collaborator

@spenserblack spenserblack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I'll leave this open for a bit for @o2sh's thoughts.

@o2sh o2sh self-requested a review March 29, 2025 11:30
Copy link
Owner

@o2sh o2sh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I tested it locally, and it seems to work as expected.

@o2sh o2sh merged commit 7ef9761 into o2sh:main Mar 29, 2025
4 checks passed
@Sk7Str1p3
Copy link
Contributor Author

@o2sh we forgot something important. flake.lock pinned nixpkgs, so after a week or less commit get outdated and lock should be refreshed. I have no idea how to work with Workflows yet so i leave this to you. Flake.lock should be updated approximately once in 10 days

@Sk7Str1p3 Sk7Str1p3 deleted the flake branch March 30, 2025 16:19
o2sh added a commit that referenced this pull request Mar 31, 2025
@o2sh
Copy link
Owner

o2sh commented Apr 1, 2025

Good point, @Sk7Str1p3. I've reverted the PR for now.

On second thought, it might not be ideal to commit these files directly to the repo since they’re tied to a specific setup (Nix).

Instead, we could add a section in the Wiki for Nix users, including the flake.nix file along with some explanations.

@spenserblack
Copy link
Collaborator

@o2sh we forgot something important. flake.lock pinned nixpkgs, so after a week or less commit get outdated and lock should be refreshed. I have no idea how to work with Workflows yet so i leave this to you. Flake.lock should be updated approximately once in 10 days

Could it just be added to the gitignore? We're not like an enterprise team with strict environment requirements, so I think it would be reasonable to just let the dev shell users manage their own lock file.

@Sk7Str1p3
Copy link
Contributor Author

Yep, we could left lock out. Also we could set workflows for updating lock. I found few solutions with that already

@Sk7Str1p3
Copy link
Contributor Author

https://github.com/DeterminateSystems/update-flake-lock this seems to be best solution as it comes from Nix developers

@o2sh
Copy link
Owner

o2sh commented Apr 6, 2025

In the meantime, I've created a page in the wiki explaining how to setup a local dev environment for onefetch using Nix: https://github.com/o2sh/onefetch/wiki/nix-local-setup

Hope that's okay with you @Sk7Str1p3

@Sk7Str1p3
Copy link
Contributor Author

Yep that's okay

@spenserblack
Copy link
Collaborator

We could probably add .envrc and flake.nix to the .gitignore so nobody accidentally commits them, then

@o2sh o2sh added the doc label Apr 12, 2025
@Sk7Str1p3
Copy link
Contributor Author

Sk7Str1p3 commented May 3, 2025

@o2sh im willing come back with much greater and comprehensive nix toolchain. Crane is library around nix with devShell, automatic tests generator and incremental builds, it also should support cachix which would not even build crates locally but simply download pre-built crates leading to much faster builds.
flake.lock won't be a problem because of workflows (renovate/determinate)

@spenserblack
Copy link
Collaborator

I think the Helix editor has a flake devshell configured, so we could probably just do what they do

@Sk7Str1p3
Copy link
Contributor Author

Sk7Str1p3 commented May 4, 2025

Helix flake not using all Nix features, I feel like they added it just 'for the sake of it'.
Also, I found out why I had issues with rmeta files, and it's not filesystem issue but nix module feature. Impermanence is commonly used setup which allows to remove all files on reboot except ones set in configuration. The main problem is it 'core' - it uses bindmounts and symlinks, and bindmounts somehow caused my problems.
Crane is able solve all this issues by building to /nix/store

@Sk7Str1p3 Sk7Str1p3 mentioned this pull request May 4, 2025
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request May 10, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [o2sh/onefetch](https://github.com/o2sh/onefetch) | minor | `2.23.1` -> `2.24.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>o2sh/onefetch (o2sh/onefetch)</summary>

### [`v2.24.0`](https://github.com/o2sh/onefetch/blob/HEAD/CHANGELOG.md#2240-2025-04-12)

[Compare Source](o2sh/onefetch@2.23.1...2.24.0)

##### New Features

-   add language support for Lean by [@&#8203;foxyseta](https://github.com/foxyseta) in o2sh/onefetch#1509
-   add language support for Typst by [@&#8203;foxyseta](https://github.com/foxyseta) in o2sh/onefetch#1508
-   add language support for Razor by [@&#8203;SrS2225a](https://github.com/SrS2225a) in o2sh/onefetch#1521

##### Chores

-   more idiomatic way to fetch HEAD refs by [@&#8203;o2sh](https://github.com/o2sh) in o2sh/onefetch#1515
-   more idiomatic way to fetch repository remote URL by [@&#8203;o2sh](https://github.com/o2sh) in o2sh/onefetch#1516
-   update holyc language logo by [@&#8203;o2sh](https://github.com/o2sh) in o2sh/onefetch#1543
-   update wiki powershell-snippet by [@&#8203;FallenDeity](https://github.com/FallenDeity) in o2sh/onefetch#1542
-   add nix local setup [@&#8203;Sk7Str1p3](https://github.com/Sk7Str1p3) in o2sh/onefetch#1549

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4xMS4yIiwidXBkYXRlZEluVmVyIjoiNDAuMTEuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants